package ui.component {
	
	import flash.display.Sprite;
	import flash.text.TextFieldAutoSize;
	
	public class Tip extends Sprite {
		
		private var label:Label;

		public function Tip() {
			super();
			label = new Label(12, 0xFFFFFF);
			label.autoSize = TextFieldAutoSize.LEFT;
			label.x = 2;
			label.y = 2;
			addChild(label);
			
			mouseEnabled = mouseChildren = false;
		}
		
		public function update(value:String):void {
			label.text = value;
			resetFrame();
		}
		
		private function resetFrame():void {
			graphics.clear();
			graphics.lineStyle(1, 0xFFFFFF);
			graphics.beginFill(0x000000, 0.5);
			graphics.drawRoundRect(0, 0, label.textWidth + 8, label.textHeight + 8, 8, 8);
		}
	}
}